package com.example.mapper;

import com.example.pojo.entity.JobRecruiter;
import com.example.pojo.entity.JobSeeker;
import com.example.pojo.entity.Post;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 小岁
 * @version 2023/10/5 23:02
 */
public interface RecruiterMapper {

    @Select("select * from job_recruiter where jr_account=#{value}")
    JobRecruiter findByJrAccount(String jrAccount);

    @Select("select * from job_recruiter where contact_person like concat('%',#{contactPerson},'%')")
    List<JobRecruiter> findByConcatPerson(@Param("contactPerson") String contactPerson);

    @Select("select * from job_recruiter where id=#{value}")
    JobRecruiter findByRecruiterId(Integer id);

    @Select("select * from job_recruiter where id=#{value}")
    JobRecruiter findById(Integer id);

    @Select("select * from job_recruiter where jr_telephone=#{value}")
    JobRecruiter findByJrTelephone(String jrTelephone);



    @Insert("insert into job_recruiter(jr_account,jr_cipher,jr_telephone) values(#{jrAccount},#{jrCipher},#{jrTelephone})")
    int TblSave(@Param("jrAccount") String jrAccount, @Param("jrCipher") String jrCipher,@Param("jrTelephone") String jrTelephone);


    @Insert("insert into job_recruiter(jr_name,jr_type,company_name,company_type,company_address,employees_quantity) values(#{jrName},#{jrType},#{companyName},#{companyType},#{companyAddress},#{employeesQuantity})")
    int jrSave(@Param("jrName")String jrName,@Param("jrType") String jrType,@Param("companyName")String companyName,@Param("companyType") String companyType,@Param("companyAddress")String companyAddress,@Param("employeesQuantity") Integer employeesQuantity);

    @Select("select * from job_recruiter")
    List<JobRecruiter> selectAll();

}
